import request from '@/utils/request'
let baseUrl = process.env.NODE_ENV === 'production' ? 'api/dashboard' : 'galaxy'
// 五级分类
export const getFiveClassList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/loan-post-report/asset-five-class-daily',
    method: 'post',
    data
  })
export const vintage = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/loan-post-report/asset-vintage-month',
    method: 'post',
    data
  })

export function getRollRate(month: string | number, productNo: string) {
  return request({
    baseURL: baseUrl,
    url: '/loan-post-report/asset-roll-rate-monthly',
    data: { month, productNo },
    method: 'post'
  })
}

export function getRepay(data: any = {}) {
  return request({
    baseURL: baseUrl,
    url: '/loan-post-report/product-repay-daily',
    data,
    method: 'post'
  })
}

export function getOverdue(data: any = {}, isDay = false) {
  return request({
    baseURL: baseUrl,
    url: `/loan-post-report/product-overdue-${isDay ? 'daily' : 'monthly'}`,
    data,
    method: 'post'
  })
}
